package com.edu.medicalpro.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.edu.medicalpro.R;
import com.edu.medicalpro.RecyclerViewadapter.HuaFeiAdapter;

public class MenZhenHuaFeiActivity extends AppCompatActivity implements View.OnClickListener{

    TextView btnOne;
    TextView btnTwo;
    TextView btnThree;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_men_zhen_hua_fei);

        btnOne = findViewById(R.id.button_one);
        btnTwo= findViewById(R.id.button_two);
        btnThree=findViewById(R.id.button_three);

        btnOne.setOnClickListener(this);
        btnTwo.setOnClickListener(this);
        btnThree.setOnClickListener(this);

        //绑定recyclerView
        RecyclerView recyclerView=findViewById(R.id.recycler_view);
        //创建RecyclerViewAdapter
        // RecyclerViewAdapter adapter=new RecyclerViewAdapter(requireActivity());
        LinearLayoutManager llg=new LinearLayoutManager(this);
        llg.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(llg);
        recyclerView.setAdapter(new HuaFeiAdapter());
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){

            case R.id.button_one:
                btnOne.setSelected(true);
                btnTwo.setSelected(false);
                btnThree.setSelected(false);
                break;
            case R.id.button_two:
                btnOne.setSelected(false);
                btnTwo.setSelected(true);
                btnThree.setSelected(false);
                break;
            case R.id.button_three:
                btnOne.setSelected(false);
                btnTwo.setSelected(false);
                btnThree.setSelected(true);
                break;
        }
    };
}